home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / chicagoa.bst (.txt) < prev    next >
LaTeX Document  |  1992-08-30  |  38KB  |  1,356 lines

  1. %%% ====================================================================
  2. %%%  @BibTeX-style-file{
  3. %%%     author          = "Glenn Paulley",
  4. %%%     version         = "4",
  5. %%%     date            = "28 August 1992",
  6. %%%     time            = "10:24:38 199",
  7. %%%     filename        = "chicagoa.bst",
  8. %%%     address         = "Data Structuring Group
  9. %%%                        Department of Computer Science
  10. %%%                        University of Waterloo
  11. %%%                        Waterloo, Ontario, Canada
  12. %%%                        N2L 3G1",
  13. %%%     telephone       = "(519) 885-1211",
  14. %%%     FAX             = "(519) 885-1208",
  15. %%%     checksum        = "62428 1684 5231 38311",
  16. %%%     email           = "gnpaulle@bluebox.uwaterloo.ca",
  17. %%%     codetable       = "ISO/ASCII",
  18. %%%     keywords        = "",
  19. %%%     supported       = "yes",
  20. %%%     abstract        = "A BibTeX bibliography style that follows the
  21. %%%                        `B' reference style of the 13th Edition of
  22. %%%                        the Chicago Manual of Style. Supports annotated
  23. %%%                        bibliographies through the BibTeX field
  24. %%%                        `annotation'. A detailed feature list is given
  25. %%%                        below.",
  26. %%%     docstring       = "The checksum field above contains a CRC-16
  27. %%%                        checksum as the first value, followed by the
  28. %%%                        equivalent of the standard UNIX wc (word
  29. %%%                        count) utility output of lines, words, and
  30. %%%                        characters.  This is produced by Robert
  31. %%%                        Solovay's checksum utility.",
  32. %%%  }
  33. %%% ====================================================================
  34. % "Chicago" BibTeX style, chicagoa.bst - Chicago style with annotations
  35. % =====================================================================
  36. % BibTeX `chicagoa' style file for BibTeX version 0.99c, LaTeX version 2.09
  37. % Place it in a file called chicagoa.bst in the BibTeX search path.
  38. % You need to include chicago.sty as a \documentstyle option.
  39. % (Placing it in the same directory as the LaTeX document should also work.)
  40. % This "chicago" style is based on newapa.bst (American Psych. Assoc.)
  41. % found at ymir.claremont.edu. Annotation support added 07/09/92.
  42. % Modifications are loosely based on Chicago Manual of Style.
  43. %   Citation format: (author-last-name year)
  44. %             (author-last-name and author-last-name year)
  45. %             (author-last-name, author-last-name, and author-last-name year)
  46. %             (author-last-name et al. year)
  47. %             (author-last-name)
  48. %             author-last-name (year)
  49. %             (author-last-name and author-last-name)
  50. %             (author-last-name et al.)
  51. %             (year) or (year,year)
  52. %             year or year,year
  53. %   Reference list ordering: alphabetical by author or whatever passes
  54. %    for author in the absence of one.
  55. % This BibTeX style has support for abbreviated author lists and for
  56. %    year-only citations.  This is done by having the citations
  57. %    actually look like
  58. %    \citeauthoryear{full-author-info}{abbrev-author-info}{year}
  59. % The LaTeX style has to have the following (or similar)
  60. %     \let\@internalcite\cite
  61. %     \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
  62. %     \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite}
  63. %     \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
  64. %     \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite}
  65. %     \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite}
  66. % These TeX macro definitions are found in chicago.sty. Additional
  67. % commands to manipulate different components of a citation can be defined
  68. % so that, for example, you can list author's names without parentheses
  69. % if using a citation as a noun or object in a sentence.
  70. % This file was originally copied from newapa.bst at ymir.claremont.edu.
  71. % Features of chicago.bst:
  72. % =======================
  73. % - supports an "annotation" field for annotated bibliographies.
  74. % - full names used in citations, but abbreviated citations are available
  75. %   (see above)
  76. % - if an entry has a "month", then the month and year are also printed
  77. %   as part of that bibitem.
  78. % - all conjunctions use "and" instead of "\&"
  79. % - major modification from Chicago Manual of Style (13th ed.) is that
  80. %   only the first author in a reference appears last name first-
  81. %   additional authors appear as J. Q. Public.
  82. % - pages are listed as "pp. xx-xx" in all entry types except
  83. %   article entries.
  84. % - book, inbook, and manual use "location: publisher" (or organization)
  85. %   for address and publisher. All other types list publishers separately.
  86. % - "pp." are used to identify page numbers for all entry types except
  87. %   articles.
  88. % - organization is used as a citation label if neither author nor editor
  89. %   is present (for manuals).
  90. % - "et al." is used for long author and editor lists, or when "others"
  91. %   is used.
  92. % Modifications and bug fixes from newapa.bst:
  93. % ===========================================
  94. %   - added month, year to bib entries if month is present
  95. %   - fixed bug with In proceedings, added necessary comma after title
  96. %   - all conjunctions changed to "and" from "\&"
  97. %   - fixed bug with author labels in my.full.label: "et al." now is
  98. %        generated when "others" is an author name
  99. %   - major modification from Chicago Manual of Style (13th ed.) is that
  100. %     only the first author in a reference appears last name first-
  101. %     additional authors appear as J. Q. Public.
  102. %   - pages are listed as "pp. xx-xx" in all entry types except
  103. %     article entries. Unnecessary (IMHO) "()" around page numbers
  104. %     were removed, and page numbers now don't end with a period.
  105. %   - created chicago.sty for use with this bibstyle (required).
  106. %   - fixed bugs in FUNCTION {format.vol.num.pages} for missing volume,
  107. %     number, and /or pages. Renamed to format.jour.vol.
  108. %   - fixed bug in formatting booktitles: additional period an error if
  109. %     book has a volume.
  110. %   - fixed bug: editors usually given redundant period before next clause
  111. %     (format.editors.dot) removed.
  112. %   - added label support for organizations, if both author and editor
  113. %     are missing (from alpha.bst). If organization is too long, then
  114. %     the key field is used for abbreviated citations.
  115. %   - In proceedings or books of several volumes, no comma was written
  116. %     between the "Volume x" and the page numbers (this was intentional
  117. %     in newapa.bst). Fixed.
  118. %   - Some journals may not have volumes/numbers, only month/year (eg.
  119. %     IEEE Computer). Fixed bug in article style that assumed volume/number
  120. %     was always present.
  121. % Original documentation for newapa.sty:
  122. % =====================================
  123. % This version was made by modifying the master file made by
  124. % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU), and the 'named' BibTeX
  125. % style of Peter F. Patel-Schneider.
  126. % Copyright (C) 1985, all rights reserved.
  127. % Copying of this file is authorized only if either
  128. % (1) you make absolutely no changes to your copy, including name, or
  129. % (2) if you do make changes, you name it something other than 'newapa.bst'.
  130. % There are undoubtably bugs in this style.  If you make bug fixes,
  131. % improvements, etc.  please let me know.  My e-mail address is:
  132. %    spencer@cgrg.ohio.state.edu or 71160.3141@compuserve.com
  133. % This style was made from 'plain.bst', 'named.bst', and 'apalike.bst',
  134. % with lots of tweaking to make it look like APA style, along with tips
  135. % from Young Ryu and Brian Reiser's modifications of 'apalike.bst'.
  136. ENTRY
  137.   { address
  138.     annotation
  139.     author
  140.     booktitle
  141.     chapter
  142.     edition
  143.     editor
  144.     howpublished
  145.     institution
  146.     journal
  147.     key
  148.     month
  149.     note
  150.     number
  151.     organization
  152.     pages
  153.     publisher
  154.     school
  155.     series
  156.     title
  157.     type
  158.     volume
  159.     year
  160.   { label.year extra.label sort.year sort.label }
  161. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  162. FUNCTION {init.state.consts}
  163. { #0 'before.all :=
  164.   #1 'mid.sentence :=
  165.   #2 'after.sentence :=
  166.   #3 'after.block :=
  167. STRINGS { s t u }
  168. FUNCTION {output.nonnull}
  169. { 's :=
  170.   output.state mid.sentence =
  171.     { ", " * write$ }
  172.     { output.state after.block =
  173.     { add.period$ write$
  174.       newline$
  175.       "\newblock " write$
  176.     }
  177.     { output.state before.all =
  178.         'write$
  179.         { add.period$ " " * write$ }
  180.       if$
  181.     }
  182.       if$
  183.       mid.sentence 'output.state :=
  184.     }
  185.   if$
  186. % Use a colon to separate output. Used only for address/publisher
  187. % combination in book/inbook types, address/institution for manuals,
  188. % and organization:publisher for proceedings (inproceedings).
  189. FUNCTION {output.nonnull.colon}
  190. { 's :=
  191.   output.state mid.sentence =
  192.     { ": " * write$ }
  193.     { output.state after.block =
  194.     { add.period$ write$
  195.       newline$
  196.       "\newblock " write$
  197.     }
  198.     { output.state before.all =
  199.         'write$
  200.         { add.period$ " " * write$ }
  201.       if$
  202.     }
  203.       if$
  204.       mid.sentence 'output.state :=
  205.     }
  206.   if$
  207. FUNCTION {output}
  208. { duplicate$ empty$
  209.     'pop$
  210.     'output.nonnull
  211.   if$
  212. FUNCTION {output.colon}
  213. { duplicate$ empty$
  214.     'pop$
  215.     'output.nonnull.colon
  216.   if$
  217. FUNCTION {output.check}
  218. { 't :=
  219.   duplicate$ empty$
  220.     { pop$ "empty " t * " in " * cite$ * warning$ }
  221.     'output.nonnull
  222.   if$
  223. FUNCTION {output.check.colon}
  224. { 't :=
  225.   duplicate$ empty$
  226.     { pop$ "empty " t * " in " * cite$ * warning$ }
  227.     'output.nonnull.colon
  228.   if$
  229. FUNCTION {output.year.check}
  230. { year empty$
  231.      { "empty year in " cite$ * warning$ }
  232.      { write$
  233.         " (" year * extra.label *
  234.        month empty$
  235.           { ")" * }
  236.           { ", " * month * ")" * }
  237.        if$
  238.        mid.sentence 'output.state :=
  239.      }
  240.   if$
  241. FUNCTION {fin.entry}
  242. { add.period$
  243.   write$
  244.   newline$
  245. FUNCTION {new.block}
  246. { output.state before.all =
  247.     'skip$
  248.     { after.block 'output.state := }
  249.   if$
  250. FUNCTION {new.sentence}
  251. { output.state after.block =
  252.     'skip$
  253.     { output.state before.all =
  254.     'skip$
  255.     { after.sentence 'output.state := }
  256.       if$
  257.     }
  258.   if$
  259. FUNCTION {not}
  260. {   { #0 }
  261.     { #1 }
  262.   if$
  263. FUNCTION {and}
  264. {   'skip$
  265.     { pop$ #0 }
  266.   if$
  267. FUNCTION {or}
  268. {   { pop$ #1 }
  269.     'skip$
  270.   if$
  271. FUNCTION {new.block.checka}
  272. { empty$
  273.     'skip$
  274.     'new.block
  275.   if$
  276. FUNCTION {new.block.checkb}
  277. { empty$
  278.   swap$ empty$
  279.   and
  280.     'skip$
  281.     'new.block
  282.   if$
  283. FUNCTION {new.sentence.checka}
  284. { empty$
  285.     'skip$
  286.     'new.sentence
  287.   if$
  288. FUNCTION {new.sentence.checkb}
  289. { empty$
  290.   swap$ empty$
  291.   and
  292.     'skip$
  293.     'new.sentence
  294.   if$
  295. FUNCTION {field.or.null}
  296. { duplicate$ empty$
  297.     { pop$ "" }
  298.     'skip$
  299.   if$
  300. % Emphasize the top string on the stack.
  301. FUNCTION {emphasize}
  302. { duplicate$ empty$
  303.     { pop$ "" }
  304.     { "{\em " swap$ * "}" * }
  305.   if$
  306. % Emphasize the top string on the stack, but add a trailing space.
  307. FUNCTION {emphasize.space}
  308. { duplicate$ empty$
  309.     { pop$ "" }
  310.     { "{\em " swap$ * "\/}" * }
  311.   if$
  312. INTEGERS { nameptr namesleft numnames }
  313. % Format bibliographical entries with the first author last name first,
  314. % and subsequent authors with initials followed by last name.
  315. % All names are formatted in this routine.
  316. FUNCTION {format.names}
  317. { 's :=
  318.   #1 'nameptr :=               % nameptr = 1;
  319.   s num.names$ 'numnames :=    % numnames = num.name$(s);
  320.   numnames 'namesleft :=
  321.     { namesleft #0 > }
  322.     { nameptr #1 =
  323.         {s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := }
  324.         {s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
  325.       if$
  326.       nameptr #1 >
  327.         { namesleft #1 >
  328.               { ", " * t * }
  329.               { numnames #2 >
  330.                   { "," * }
  331.                   'skip$
  332.                 if$
  333.                 t "others" =
  334.                     { " et~al." * }
  335.                     { " and " * t * } % from Chicago Manual of Style
  336.                   if$
  337.                }
  338.                if$
  339.              }
  340.             't
  341.         if$
  342.         nameptr #1 + 'nameptr :=          % nameptr += 1;
  343.         namesleft #1 - 'namesleft :=      % namesleft =- 1;
  344.     }
  345.   while$
  346. FUNCTION {my.full.label}
  347. { 's :=
  348.   #1 'nameptr :=               % nameptr = 1;
  349.   s num.names$ 'numnames :=    % numnames = num.name$(s);
  350.   numnames 'namesleft :=
  351.     { namesleft #0 > }
  352.     { s nameptr "{vv~}{ll}" format.name$ 't :=  % get the next name
  353.       nameptr #1 >
  354.         { namesleft #1 >
  355.               { ", " * t * }
  356.               { numnames #2 >
  357.                   { "," * }
  358.                   'skip$
  359.                 if$
  360.                 t "others" =
  361.                     { " et~al." * }
  362.                     { " and " * t * } % from Chicago Manual of Style
  363.                   if$
  364.                }
  365.                if$
  366.              }
  367.             't
  368.         if$
  369.         nameptr #1 + 'nameptr :=          % nameptr += 1;
  370.         namesleft #1 - 'namesleft :=      % namesleft =- 1;
  371.     }
  372.   while$
  373. FUNCTION {format.names.fml}
  374. % Format names in "familiar" format, with first initial followed by
  375. % last name. Like format.names, ALL names are formatted.
  376. { 's :=
  377.   #1 'nameptr :=               % nameptr = 1;
  378.   s num.names$ 'numnames :=    % numnames = num.name$(s);
  379.   numnames 'namesleft :=
  380.     { namesleft #0 > }
  381.     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  382.       nameptr #1 >
  383.         { namesleft #1 >
  384.               { ", " * t * }
  385.                { numnames #2 >
  386.                     { "," * }
  387.                     'skip$
  388.                   if$
  389.                   t "others" =
  390.                         { " et~al." * }
  391.                         { " and " * t * }
  392. %                       { " \& " * t * }
  393.                       if$
  394.                 }
  395.                if$
  396.              }
  397.             't
  398.         if$
  399.         nameptr #1 + 'nameptr :=          % nameptr += 1;
  400.         namesleft #1 - 'namesleft :=      % namesleft =- 1;
  401.     }
  402.   while$
  403. FUNCTION {format.annotation}
  404. { annotation empty$
  405.     { "" }
  406.     { " \begin{quotation}\noindent "
  407.       annotation
  408.       * " \end{quotation} " *
  409.       if$
  410. FUNCTION {format.authors}
  411. { author empty$
  412.     { "" }
  413.     { author format.names }
  414.   if$
  415. FUNCTION {format.key}
  416. { empty$
  417.     { key field.or.null }
  418.     { "" }
  419.   if$
  420. % Format editor names for use in the "in" types: inbook, incollection,
  421. % inproceedings: first initial, then last names. When editors are the
  422. % LABEL for an entry, then format.editor is used which lists editors
  423. % by last name first.
  424. FUNCTION {format.editors.fml}
  425. { editor empty$
  426.     { "" }
  427.     { editor format.names.fml
  428.       editor num.names$ #1 >
  429.     { " (Eds.)" * }
  430.     { " (Ed.)" * }
  431.       if$
  432.     }
  433.   if$
  434. % Format editor names for use in labels, last names first.
  435. FUNCTION {format.editors}
  436. { editor empty$
  437.     { "" }
  438.     { editor format.names
  439.       editor num.names$ #1 >
  440.     { " (Eds.)" * }
  441.     { " (Ed.)" * }
  442.       if$
  443.     }
  444.   if$
  445. FUNCTION {format.title}
  446. { title empty$
  447.     { "" }
  448.     { title "t" change.case$ }
  449.   if$
  450. % Note that the APA style requres case changes
  451. % in article titles. The following does not
  452. % change cases. If you perfer it, uncomment the
  453. % following and comment out the above.
  454. %FUNCTION {format.title}
  455. %{ title empty$
  456. %    { "" }
  457. %    { title }
  458. %  if$
  459. FUNCTION {n.dashify}
  460. { 't :=
  461.     { t empty$ not }
  462.     { t #1 #1 substring$ "-" =
  463.     { t #1 #2 substring$ "--" = not
  464.         { "--" *
  465.           t #2 global.max$ substring$ 't :=
  466.         }
  467.         {   { t #1 #1 substring$ "-" = }
  468.         { "-" *
  469.           t #2 global.max$ substring$ 't :=
  470.         }
  471.           while$
  472.         }
  473.       if$
  474.     }
  475.     { t #1 #1 substring$ *
  476.       t #2 global.max$ substring$ 't :=
  477.     }
  478.       if$
  479.     }
  480.   while$
  481. FUNCTION {format.btitle}
  482. { edition empty$
  483.   { title emphasize }
  484.   { title empty$
  485.     { title emphasize }
  486.     { volume empty$     % gnp - check for volume, then don't need period
  487.        { "{\em " title * "\/} (" * edition * " ed.)" * "." * }
  488.        { "{\em " title * "\/} (" * edition * " ed.)" * }
  489.       if$
  490.     }
  491.     if$
  492.   if$
  493. FUNCTION {format.emphasize.booktitle}
  494. { edition empty$
  495.   { booktitle emphasize }
  496.   { booktitle empty$
  497.     { booktitle emphasize }
  498.     { volume empty$    % gnp - extra period an error if book has a volume
  499.         { "{\em " booktitle * "\/} (" * edition * " ed.)" * "." *}
  500.         { "{\em " booktitle * "\/} (" * edition * " ed.)" * }
  501.       if$
  502.       }
  503.     if$
  504.     }
  505.   if$
  506. FUNCTION {tie.or.space.connect}
  507. { duplicate$ text.length$ #3 <
  508.     { "~" }
  509.     { " " }
  510.   if$
  511.   swap$ * *
  512. FUNCTION {either.or.check}
  513. { empty$
  514.     'pop$
  515.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  516.   if$
  517. FUNCTION {format.bvolume}
  518. { volume empty$
  519.     { "" }
  520.     { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
  521.       series empty$
  522.         'skip$
  523.         { " of " * series emphasize * }
  524.       if$
  525.       "volume and number" number either.or.check
  526.     }
  527.   if$
  528. FUNCTION {format.number.series}
  529. { volume empty$
  530.     { number empty$
  531.     { series field.or.null }
  532.     { output.state mid.sentence =
  533.         { "Number" } % gnp - changed to mixed case always
  534.         { "Number" }
  535.       if$
  536.       number tie.or.space.connect
  537.       series empty$
  538.         { "there's a number but no series in " cite$ * warning$ }
  539.         { " in " * series * }
  540.       if$
  541.     }
  542.       if$
  543.     }
  544.     { "" }
  545.   if$
  546. INTEGERS { multiresult }
  547. FUNCTION {multi.page.check}
  548. { 't :=
  549.   #0 'multiresult :=
  550.     { multiresult not
  551.       t empty$ not
  552.       and
  553.     }
  554.     { t #1 #1 substring$
  555.       duplicate$ "-" =
  556.       swap$ duplicate$ "," =
  557.       swap$ "+" =
  558.       or or
  559.     { #1 'multiresult := }
  560.     { t #2 global.max$ substring$ 't := }
  561.       if$
  562.     }
  563.   while$
  564.   multiresult
  565. FUNCTION {format.pages}
  566. { pages empty$
  567.   { "" }
  568.   { pages multi.page.check
  569.     { "pp.\ " pages n.dashify tie.or.space.connect } % gnp - removed ()
  570.     { "pp.\ " pages tie.or.space.connect }
  571.     if$
  572.   if$
  573. % By Young (and Spencer)
  574. % GNP - fixed bugs with missing volume, number, and/or pages
  575. % Format journal, volume, number, pages for article types.
  576. FUNCTION {format.jour.vol}
  577. { journal empty$
  578.     { "no journal in " cite$ * warning$
  579.       "" }
  580.     { journal emphasize.space }
  581.     if$
  582.   number empty$
  583.     { volume empty$
  584.        { "no number and no volume in " cite$ * warning$
  585.          "" * }
  586.        { "~{\em " * Volume * "}" * }
  587.       if$
  588.     }
  589.     { volume empty$
  590.       {"no volume for " cite$ * warning$
  591.        "~(" * number * ")" * }
  592.       { "~" *
  593.         volume emphasize.space
  594.         "(" * number * ")" * * }
  595.       if$
  596.     }
  597.   if$
  598.   pages empty$
  599.     {"page numbers missing in " cite$ * warning$
  600.      "" * } % gnp - place a null string on the stack for output
  601.     { duplicate$ empty$
  602.       { pop$ format.pages }
  603.       { ", " *  pages n.dashify * } % gnp - removed pp. for articles
  604.       if$
  605.     }
  606.   if$
  607. FUNCTION {format.chapter.pages}
  608. { chapter empty$
  609.     'format.pages
  610.     { type empty$
  611.         { "Chapter" } % gnp - changed to mixed case
  612.         { type "t" change.case$ }
  613.       if$
  614.       chapter tie.or.space.connect
  615.       pages empty$
  616.         {"page numbers missing in " cite$ * warning$} % gnp - added check
  617.         { ", " * format.pages * }
  618.       if$
  619.     }
  620.   if$
  621. FUNCTION {format.in.ed.booktitle}
  622. { booktitle empty$
  623.   { "" }
  624.   { editor empty$
  625.     { "In " format.emphasize.booktitle * }
  626.     { "In " format.editors.fml * ", " * format.emphasize.booktitle * }
  627.     if$
  628.   if$
  629. FUNCTION {format.thesis.type}
  630. { type empty$
  631.     'skip$
  632.     { pop$
  633.       type "t" change.case$
  634.     }
  635.   if$
  636. FUNCTION {format.tr.number}
  637. { type empty$
  638.     { "Technical Report" }
  639.     'type
  640.   if$
  641.   number empty$
  642.     { "t" change.case$ }
  643.     { number tie.or.space.connect }
  644.   if$
  645. FUNCTION {format.article.crossref}
  646. { "See"
  647.   "\citeN{" * crossref * "}" *
  648. FUNCTION {format.crossref.editor}
  649. { editor #1 "{vv~}{ll}" format.name$
  650.   editor num.names$ duplicate$
  651.   #2 >
  652.     { pop$ " et~al." * }
  653.     { #2 <
  654.     'skip$
  655.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  656.         { " et~al." * }
  657.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  658.       if$
  659.     }
  660.       if$
  661.     }
  662.   if$
  663. FUNCTION {format.book.crossref}
  664. { volume empty$
  665.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  666.       "In "
  667.     }
  668.     { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
  669.       " of " *
  670.     }
  671.   if$
  672.   editor empty$
  673.   editor field.or.null author field.or.null =
  674.     { key empty$
  675.     { series empty$
  676.         { "need editor, key, or series for " cite$ * " to crossref " *
  677.           crossref * warning$
  678.           "" *
  679.         }
  680.         { "{\em " * series * "\/}" * }
  681.       if$
  682.     }
  683.     { key * }
  684.       if$
  685.     }
  686.     { format.crossref.editor * }
  687.   if$
  688.   " \citeN{" * crossref * "}" *
  689. FUNCTION {format.incoll.inproc.crossref}
  690. { "See"
  691.   " \citeN{" * crossref * "}" *
  692. % format.lab.names:
  693. % determines "short" names for the abbreviated author information.
  694. % "Long" labels are created in calc.label, using the routine my.full.label
  695. % to format author and editor fields.
  696. % There are 4 cases for labels.   (n=3 in the example)
  697. % a) one author             Foo
  698. % b) one to n               Foo, Bar and Baz
  699. % c) use of "and others"    Foo, Bar et al.
  700. % d) more than n            Foo et al.
  701. FUNCTION {format.lab.names}
  702. { 's :=
  703.   s num.names$ 'numnames :=
  704.   numnames #2 >    % change number to number of others allowed before
  705.            % forcing "et al".
  706.     { s #1 "{vv~}{ll}" format.name$ " et~al." * }
  707.     {
  708.       numnames #1 - 'namesleft :=
  709.       #2 'nameptr :=
  710.       s #1 "{vv~}{ll}" format.name$
  711.     { namesleft #0 > }
  712.     { nameptr numnames =
  713.         { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  714.         { " et~al." * }
  715.         { " and " * s nameptr "{vv~}{ll}" format.name$ * }
  716.           if$
  717.         }
  718.         { ", " * s nameptr "{vv~}{ll}" format.name$ * }
  719.       if$
  720.       nameptr #1 + 'nameptr :=
  721.       namesleft #1 - 'namesleft :=
  722.       while$
  723.     }
  724.   if$
  725. FUNCTION {author.key.label}
  726. { author empty$
  727.     { key empty$
  728.           { "no key, author in " cite$ * warning$
  729.             cite$ #1 #3 substring$ }
  730.          'key
  731.       if$
  732.     }
  733.     { author format.lab.names }
  734.   if$
  735. FUNCTION {editor.key.label}
  736. { editor empty$
  737.     { key empty$
  738.           { "no key, editor in " cite$ * warning$
  739.             cite$ #1 #3 substring$ }
  740.           'key
  741.         if$
  742.      }
  743.      { editor format.lab.names }
  744.   if$
  745. FUNCTION {author.key.organization.label}
  746. % added - gnp. Provide label formatting by organization if author is null.
  747. { author empty$
  748.     { organization empty$
  749.     { key empty$
  750.         { "no key, author or organization in " cite$ * warning$
  751.               cite$ #1 #3 substring$ }
  752.         'key
  753.       if$
  754.         { organization }
  755.       if$
  756.     }
  757.     { author format.lab.names }
  758.   if$
  759. FUNCTION {editor.key.organization.label}
  760. % added - gnp. Provide label formatting by organization if editor is null.
  761. { editor empty$
  762.     { organization empty$
  763.     { key empty$
  764.         { "no key, editor or organization in " cite$ * warning$
  765.               cite$ #1 #3 substring$ }
  766.         'key
  767.       if$
  768.         { organization }
  769.       if$
  770.     }
  771.     { editor format.lab.names }
  772.   if$
  773. FUNCTION {author.editor.key.label}
  774. { author empty$
  775.     { editor empty$
  776.           { key empty$
  777.                { "no key, author, or editor in " cite$ * warning$
  778.                  cite$ #1 #3 substring$ }
  779.              'key
  780.            if$
  781.          }
  782.           { editor format.lab.names }
  783.       if$
  784.     }
  785.     { author format.lab.names }
  786.   if$
  787. FUNCTION {calc.label}
  788. % Changed - GNP. See also author.organization.sort, editor.organization.sort
  789. % Form label for BibTeX entry. The classification of which fields are used
  790. % for which type of entry (book, inbook, etc.) are taken from alpha.bst.
  791. % The change here from newapa is to also include organization as a
  792. % citation label if author or editor is missing.
  793. { type$ "book" =
  794.   type$ "inbook" =
  795.     'author.editor.key.label
  796.     { type$ "proceedings" =
  797.     'editor.key.organization.label
  798.     { type$ "manual" =
  799.         'author.key.organization.label
  800.         'author.key.label
  801.       if$
  802.       if$
  803.     }
  804.   if$
  805.   author empty$  % generate the full label citation information.
  806.     { editor empty$
  807.         { organization empty$
  808.            { "no author, editor, or organization in " cite$ * warning$
  809.              "??" }
  810.            { organization }
  811.            if$
  812.         }
  813.         { editor my.full.label }
  814.         if$
  815.     }
  816.     { author my.full.label }
  817.   if$
  818. % leave label on the stack, to be popped when required.
  819.   "}{" * swap$ * "}{" *
  820. %  year field.or.null purify$ #-1 #4 substring$ *
  821. % save the year for sort processing afterwards (adding a, b, c, etc.)
  822.   year field.or.null purify$ #-1 #4 substring$
  823.   'label.year :=
  824. FUNCTION {output.bibitem}
  825. { newline$
  826.   "\bibitem[\protect\citeauthoryear{" write$
  827.   calc.label write$
  828.   sort.year write$
  829.   "}]{" write$
  830.   cite$ write$
  831.   "}" write$
  832.   newline$
  833.   before.all 'output.state :=
  834. FUNCTION {article}
  835. { output.bibitem
  836.   format.authors
  837.   "author" output.check
  838.   author format.key output          % added
  839.   output.year.check                 % added
  840.   new.block
  841.   format.title
  842.   "title" output.check
  843.   new.block
  844.   crossref missing$
  845.     { format.jour.vol output
  846.     }
  847.     { format.article.crossref output.nonnull
  848.       format.pages output
  849.     }
  850.   if$
  851.   new.block
  852.   note output
  853.   fin.entry
  854.   format.annotation write$
  855.   newline$
  856. FUNCTION {book}
  857. { output.bibitem
  858.   author empty$
  859.     { format.editors
  860.       "author and editor" output.check }
  861.     { format.authors
  862.       output.nonnull
  863.       crossref missing$
  864.         { "author and editor" editor either.or.check }
  865.         'skip$
  866.       if$
  867.     }
  868.   if$
  869.   output.year.check       % added
  870.   new.block
  871.   format.btitle
  872.   "title" output.check
  873.   crossref missing$
  874.     { format.bvolume output
  875.       new.block
  876.       format.number.series output
  877.       new.sentence
  878.       address output
  879.       publisher "publisher" output.check.colon
  880.     }
  881.     { new.block
  882.       format.book.crossref output.nonnull
  883.     }
  884.   if$
  885.   new.block
  886.   note output
  887.   fin.entry
  888.   format.annotation write$
  889.   newline$
  890. FUNCTION {booklet}
  891. { output.bibitem
  892.   format.authors output
  893.   author format.key output          % added
  894.   output.year.check                 % added
  895.   new.block
  896.   format.title
  897.   "title" output.check
  898.   new.block
  899.   howpublished output
  900.   address output
  901.   new.block
  902.   note output
  903.   fin.entry
  904.   format.annotation write$
  905. FUNCTION {inbook}
  906. { output.bibitem
  907.   author empty$
  908.     { format.editors
  909.       "author and editor" output.check
  910.     }
  911.     { format.authors output.nonnull
  912.       crossref missing$
  913.     { "author and editor" editor either.or.check }
  914.     'skip$
  915.       if$
  916.     }
  917.   if$
  918.   output.year.check                 % added
  919.   new.block
  920.   format.btitle
  921.   "title" output.check
  922.   crossref missing$
  923.     { format.bvolume output
  924.       format.chapter.pages
  925.       "chapter and pages" output.check
  926.       new.block
  927.       format.number.series output
  928.       new.sentence
  929.       address output
  930.       publisher
  931.       "publisher" output.check.colon
  932.     }
  933.     { format.chapter.pages "chapter and pages" output.check
  934.       new.block
  935.       format.book.crossref output.nonnull
  936.     }
  937.   if$
  938.   new.block
  939.   note output
  940.   fin.entry
  941.   format.annotation write$
  942. FUNCTION {incollection}
  943. { output.bibitem
  944.   format.authors
  945.   "author" output.check
  946.   author format.key output       % added
  947.   output.year.check              % added
  948.   new.block
  949.   format.title
  950.   "title" output.check
  951.   new.block
  952.   crossref missing$
  953.   { format.in.ed.booktitle
  954.     "booktitle" output.check
  955.     format.bvolume output
  956.     format.number.series output
  957.     format.chapter.pages output % gnp - was special.output.nonnull
  958. %                                 left out comma before page numbers
  959.     new.sentence
  960.     address output
  961.     publisher "publisher" output.check.colon
  962.   { format.incoll.inproc.crossref
  963.     output.nonnull
  964.     format.chapter.pages output
  965.   if$
  966.   new.block
  967.   note output
  968.   fin.entry
  969.   format.annotation write$
  970. FUNCTION {inproceedings}
  971. { output.bibitem
  972.   format.authors
  973.   "author" output.check
  974.   author format.key output            % added
  975.   output.year.check                   % added
  976.   new.block
  977.   format.title
  978.   "title" output.check
  979.   new.block
  980.   crossref missing$
  981.     { format.in.ed.booktitle
  982.       "booktitle" output.check
  983.       format.bvolume output
  984.       format.number.series output
  985.       address output
  986.       format.pages output
  987.       new.sentence
  988.       organization output
  989.       publisher output.colon
  990.     }
  991.     { format.incoll.inproc.crossref output.nonnull
  992.       format.pages output
  993.     }
  994.   if$
  995.   new.block
  996.   note output
  997.   fin.entry
  998.   format.annotation write$
  999. FUNCTION {conference} { inproceedings }
  1000. FUNCTION {manual}
  1001. { output.bibitem
  1002.   author empty$
  1003.     { editor empty$
  1004.       { organization "organization" output.check
  1005.         organization format.key output }  % if all else fails, use key
  1006.       { format.editors "author and editor" output.check }
  1007.       if$
  1008.     }
  1009.     { format.authors output.nonnull }
  1010.     if$
  1011.   output.year.check                 % added
  1012.   new.block
  1013.   format.btitle
  1014.   "title" output.check
  1015.   organization address new.block.checkb
  1016. % Reversed the order of "address" and "organization", added the ":".
  1017.   address output
  1018.   organization "organization" output.check.colon
  1019. %  address output
  1020. %  ":" output
  1021. %  organization output
  1022.   new.block
  1023.   note output
  1024.   fin.entry
  1025.   format.annotation write$
  1026. FUNCTION {mastersthesis}
  1027. { output.bibitem
  1028.   format.authors
  1029.   "author" output.check
  1030.   author format.key output          % added
  1031.   output.year.check                 % added
  1032.   new.block
  1033.   format.title
  1034.   "title" output.check
  1035.   new.block
  1036.   "Master's thesis" format.thesis.type output.nonnull
  1037.   school "school" output.check
  1038.   address output
  1039.   new.block
  1040.   note output
  1041.   fin.entry
  1042.   format.annotation write$
  1043. FUNCTION {misc}
  1044. { output.bibitem
  1045.   format.authors output
  1046.   author format.key output            % added
  1047.   output.year.check                   % added
  1048.   title howpublished new.block.checkb
  1049.   format.title output
  1050.   new.block
  1051.   howpublished output
  1052.   new.block
  1053.   note output
  1054.   fin.entry
  1055.   format.annotation write$
  1056. FUNCTION {phdthesis}
  1057. { output.bibitem
  1058.   format.authors
  1059.   "author" output.check
  1060.   author format.key output            % added
  1061.   output.year.check                   % added
  1062.   new.block
  1063.   format.btitle
  1064.   "title" output.check
  1065.   new.block
  1066.   "Ph.\ D. thesis" format.thesis.type output.nonnull
  1067.   school "school" output.check
  1068.   address output
  1069.   new.block
  1070.   note output
  1071.   fin.entry
  1072.   format.annotation write$
  1073. FUNCTION {proceedings}
  1074. { output.bibitem
  1075.   editor empty$
  1076.     { organization output
  1077.       organization format.key output }  % gnp - changed from author format.key
  1078.     { format.editors output.nonnull }
  1079.   if$
  1080. % author format.key output             % gnp - removed (should be either
  1081. %                                        editor or organization
  1082.   output.year.check                    % added (newapa)
  1083.   new.block
  1084.   format.btitle
  1085.   "title" output.check
  1086.   format.bvolume output
  1087.   format.number.series output
  1088.   address output
  1089.   new.sentence
  1090.   organization output
  1091.   publisher output.colon
  1092.   new.block
  1093.   note output
  1094.   fin.entry
  1095.   format.annotation write$
  1096. FUNCTION {techreport}
  1097. { output.bibitem
  1098.   format.authors
  1099.   "author" output.check
  1100.   author format.key output             % added
  1101.   output.year.check                    % added
  1102.   new.block
  1103.   format.title
  1104.   "title" output.check
  1105.   new.block
  1106.   format.tr.number output.nonnull
  1107.   institution
  1108.   "institution" output.check
  1109.   address output
  1110.   new.block
  1111.   note output
  1112.   fin.entry
  1113.   format.annotation write$
  1114. FUNCTION {unpublished}
  1115. { output.bibitem
  1116.   format.authors
  1117.   "author" output.check
  1118.   author format.key output              % added
  1119.   output.year.check                      % added
  1120.   new.block
  1121.   format.title
  1122.   "title" output.check
  1123.   new.block
  1124.   note "note" output.check
  1125.   fin.entry
  1126.   format.annotation write$
  1127. FUNCTION {default.type} { misc }
  1128. MACRO {jan} {"January"}
  1129. MACRO {feb} {"February"}
  1130. MACRO {mar} {"March"}
  1131. MACRO {apr} {"April"}
  1132. MACRO {may} {"May"}
  1133. MACRO {jun} {"June"}
  1134. MACRO {jul} {"July"}
  1135. MACRO {aug} {"August"}
  1136. MACRO {sep} {"September"}
  1137. MACRO {oct} {"October"}
  1138. MACRO {nov} {"November"}
  1139. MACRO {dec} {"December"}
  1140. MACRO {acmcs} {"ACM Computing Surveys"}
  1141. MACRO {acta} {"Acta Informatica"}
  1142. MACRO {ai} {"Artificial Intelligence"}
  1143. MACRO {cacm} {"Communications of the ACM"}
  1144. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  1145. MACRO {ibmsj} {"IBM Systems Journal"}
  1146. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  1147. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  1148. MACRO {ieeetcad}
  1149.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1150. MACRO {ipl} {"Information Processing Letters"}
  1151. MACRO {jacm} {"Journal of the ACM"}
  1152. MACRO {jcss} {"Journal of Computer and System Sciences"}
  1153. MACRO {scp} {"Science of Computer Programming"}
  1154. MACRO {sicomp} {"SIAM Journal on Computing"}
  1155. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1156. MACRO {tods} {"ACM Transactions on Database Systems"}
  1157. MACRO {tog} {"ACM Transactions on Graphics"}
  1158. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1159. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1160. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1161. MACRO {tcs} {"Theoretical Computer Science"}
  1162. FUNCTION {sortify}
  1163. { purify$
  1164.   "l" change.case$
  1165. INTEGERS { len }
  1166. FUNCTION {chop.word}
  1167. { 's :=
  1168.   'len :=
  1169.   s #1 len substring$ =
  1170.     { s len #1 + global.max$ substring$ }
  1171.     's
  1172.   if$
  1173. FUNCTION {sort.format.names}
  1174. { 's :=
  1175.   #1 'nameptr :=
  1176.   s num.names$ 'numnames :=
  1177.   numnames 'namesleft :=
  1178.     { namesleft #0 > }
  1179.     { nameptr #1 >
  1180.           { "   " * }
  1181.          'skip$
  1182.       if$
  1183.       s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't :=
  1184.       nameptr numnames = t "others" = and
  1185.           { " et~al" * }
  1186.           { t sortify * }
  1187.       if$
  1188.       nameptr #1 + 'nameptr :=
  1189.       namesleft #1 - 'namesleft :=
  1190.     }
  1191.   while$
  1192. FUNCTION {sort.format.title}
  1193. { 't :=
  1194.   "A " #2
  1195.     "An " #3
  1196.       "The " #4 t chop.word
  1197.     chop.word
  1198.   chop.word
  1199.   sortify
  1200.   #1 global.max$ substring$
  1201. FUNCTION {author.sort}
  1202. { author empty$
  1203.     { key empty$
  1204.          { "to sort, need author or key in " cite$ * warning$
  1205.            "" }
  1206.          { key sortify }
  1207.       if$
  1208.     }
  1209.     { author sort.format.names }
  1210.   if$
  1211. FUNCTION {editor.sort}
  1212. { editor empty$
  1213.     { key empty$
  1214.          { "to sort, need editor or key in " cite$ * warning$
  1215.            ""
  1216.          }
  1217.          { key sortify }
  1218.       if$
  1219.     }
  1220.     { editor sort.format.names }
  1221.   if$
  1222. FUNCTION {author.editor.sort}
  1223. { author empty$
  1224.     { "missing author in " cite$ * warning$
  1225.       editor empty$
  1226.          { key empty$
  1227.              { "to sort, need author, editor, or key in " cite$ * warning$
  1228.                ""
  1229.              }
  1230.              { key sortify }
  1231.            if$
  1232.          }
  1233.          { editor sort.format.names }
  1234.       if$
  1235.     }
  1236.     { author sort.format.names }
  1237.   if$
  1238. FUNCTION {author.organization.sort}
  1239. % added - GNP. Stack author or organization for sorting (from alpha.bst).
  1240. % Unlike alpha.bst, we need entire names, not abbreviations
  1241. { author empty$
  1242.     { organization empty$
  1243.     { key empty$
  1244.         { "to sort, need author, organization, or key in " cite$ * warning$
  1245.           ""
  1246.         }
  1247.         { key sortify }
  1248.       if$
  1249.     { organization sortify }
  1250.       if$
  1251.     }
  1252.     { author sort.format.names }
  1253.   if$
  1254. FUNCTION {editor.organization.sort}
  1255. % added - GNP. Stack editor or organization for sorting (from alpha.bst).
  1256. % Unlike alpha.bst, we need entire names, not abbreviations
  1257. { editor empty$
  1258.     { organization empty$
  1259.     { key empty$
  1260.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1261.           ""
  1262.         }
  1263.         { key sortify }
  1264.       if$
  1265.     { organization sortify }
  1266.       if$
  1267.     }
  1268.     { editor sort.format.names }
  1269.   if$
  1270. FUNCTION {presort}
  1271. % Presort creates the bibentry's label via a call to calc.label, and then
  1272. % sorts the entries based on entry type. Chicago.bst adds support for
  1273. % including organizations as the sort key; the following is stolen from
  1274. % alpha.bst.
  1275. { calc.label sortify % recalculate bibitem label
  1276.   year field.or.null purify$ #-1 #4 substring$ * % add year
  1277.   "    "
  1278.   type$ "book" =
  1279.   type$ "inbook" =
  1280.     'author.editor.sort
  1281.     { type$ "proceedings" =
  1282.     'editor.organization.sort
  1283.     { type$ "manual" =
  1284.         'author.organization.sort
  1285.         'author.sort
  1286.       if$
  1287.       if$
  1288.     }
  1289.   if$
  1290.   #1 entry.max$ substring$        % added for newapa
  1291.   'sort.label :=                  % added for newapa
  1292.   sort.label                      % added for newapa
  1293.   "    "
  1294.   title field.or.null
  1295.   sort.format.title
  1296.   #1 entry.max$ substring$
  1297.   'sort.key$ :=
  1298. ITERATE {presort}
  1299. SORT             % by label, year, author/editor, title
  1300. STRINGS { last.label next.extra }
  1301. INTEGERS { last.extra.num }
  1302. FUNCTION {initialize.extra.label.stuff}
  1303. { #0 int.to.chr$ 'last.label :=
  1304.   "" 'next.extra :=
  1305.   #0 'last.extra.num :=
  1306. FUNCTION {forward.pass}
  1307. % Pass through all entries, comparing current entry to last one.
  1308. % Need to concatenate year to the stack (done by calc.label) to determine
  1309. % if two entries are the same (see presort)
  1310. { last.label
  1311.   calc.label year field.or.null purify$ #-1 #4 substring$ * % add year
  1312.   #1 entry.max$ substring$ =     % are they equal?
  1313.      { last.extra.num #1 + 'last.extra.num :=
  1314.        last.extra.num int.to.chr$ 'extra.label :=
  1315.      }
  1316.      { "a" chr.to.int$ 'last.extra.num :=
  1317.        "" 'extra.label :=
  1318.        calc.label year field.or.null purify$ #-1 #4 substring$ * % add year
  1319.        #1 entry.max$ substring$ 'last.label := % assign to last.label
  1320.      }
  1321.   if$
  1322. FUNCTION {reverse.pass}
  1323. { next.extra "b" =
  1324.     { "a" 'extra.label := }
  1325.      'skip$
  1326.   if$
  1327.   label.year extra.label * 'sort.year :=
  1328.   extra.label 'next.extra :=
  1329. EXECUTE {initialize.extra.label.stuff}
  1330. ITERATE {forward.pass}
  1331. REVERSE {reverse.pass}
  1332. FUNCTION {bib.sort.order}
  1333. { sort.label
  1334.   "    "
  1335.   year field.or.null sortify
  1336.   "    "
  1337.   title field.or.null
  1338.   sort.format.title
  1339.   #1 entry.max$ substring$
  1340.   'sort.key$ :=
  1341. ITERATE {bib.sort.order}
  1342. SORT             % by sort.label, year, title --- giving final bib. order.
  1343. FUNCTION {begin.bib}
  1344. { preamble$ empty$
  1345.     'skip$
  1346.     { preamble$ write$ newline$ }
  1347.   if$
  1348.   "\begin{thebibliography}{}" write$ newline$
  1349. EXECUTE {begin.bib}
  1350. EXECUTE {init.state.consts}
  1351. ITERATE {call.type$}
  1352. FUNCTION {end.bib}
  1353. { newline$
  1354.   "\end{thebibliography}" write$ newline$
  1355. EXECUTE {end.bib}
  1356.